import http from '@ohos.net.http'
import { Data } from '../types/Comm'
import { BannerItem, CategoryItem, GuessItem, HotItem, PageParams, PageResult } from '../types/home'
import { ht2 } from '../utils/ht2'

export const getHomeBannerAPI = (distributionSite = 1) => {
  return ht2<BannerItem[]>('/home/banner', {
    method: http.RequestMethod.GET,
    extraData: { distributionSite }
  })
}

export const getHomeCategoryAPI = () => {
  return ht2<CategoryItem[]>('/home/category/mutli', {
    method: http.RequestMethod.GET
  })
}

export const getHomeHotAPI = () => {
  return ht2<HotItem[]>('/home/hot/mutli', {
    method: http.RequestMethod.GET
  })
}

export const getHomeGoodsGuessLikeAPI = (pageParams: PageParams) => {
  return ht2<PageResult<GuessItem>>('/home/goods/guessLike', {
    method: http.RequestMethod.GET,
    extraData: {pageParams}
  })
}
